﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using FakeMarketplace.Models;

namespace FakeMarketplace
{
    public class MainViewModel : INotifyPropertyChanged
    {
        public MainViewModel()
        {
            this.Apps = new List<FakeApp>();
        LoadData();
		}


        public List<FakeApp> Apps { get; private set; }


        public void LoadData()
        {
            // Sample data; replace with real data
          
            this.Apps.Add(new FakeApp(){Name=MyApp.MyAppData.Title,Subtitle=MyApp.MyAppData.ShortDescription,Description=MyApp.MyAppData.Description,Author=MyApp.MyAppData.Author,Image="/MyApp/Tile.png"});
            
            this.Apps.Add(new FakeApp() { Name = "Fuse", Subtitle = "Newsreader In Motion", Image = "/FakeApps/FuseIcon.png",Author="rudy huyn" });
            this.Apps.Add(new FakeApp() { Name = "TVShow", Subtitle = "TV Show tracker", Image = "/FakeApps/TVShowIcon.png", Author = "rudy huyn" });
            this.Apps.Add(new FakeApp() { Name = "Facebook", Subtitle = "Habitant inceptos", Image = "/FakeApps/FacebookIcon.png", Author = "Microsoft Corporation" });
            this.Apps.Add(new FakeApp() { Name = "iDaft", Subtitle = "Mix Daft Punk", Image = "/FakeApps/DaftIcon.png", Author = "rudy huyn" });
            this.Apps.Add(new FakeApp() { Name = "TouchDevelop", Subtitle = "Develop everything", Image = "/FakeApps/TouchDevelopIcon.png", Author = "Microsoft Corporation" });
           
        }
        
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            if (null != PropertyChanged)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}